package com.cms.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cms.server.model.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.cms.server.model.Contract;

import java.util.List;
import java.util.Optional;

@Mapper
public interface ContractMapper extends BaseMapper<Contract> {
    @Select("select * from t_contract where user_id = #{user_id} and del = 0")
    List<Contract> selectById(Integer user_id);

    @Delete("delete * from t_contract where name is NULL and user_id = #{user_id}")
    boolean deleteNoName(int user_id);
}
